//
//  Player.h
//  Player: superclass player
//
//  Created by Enric Vergara on 20.10.12. 
//  Copyright OWLAB 2010. All rights reserved.



//---- Imports-----
#import <Foundation/Foundation.h>
#import "cocos2d.h"
#import "Player_def.h"
#import "ChangePlayerMenu.h"
//-----------------

@class CPokerTexasHoldem;

@interface CPlayer : CCSprite 
{

@public
    
    CChangePlayerMenu   * m_ChangePlayerMenu;
    CPokerTexasHoldem*  m_pPokerGame;
    unsigned int        m_uiID;
    TYPE_PLAYER         m_eTypePlayer;
    CGPoint             m_Position;
    float               m_fRotation;
    float               m_fCounterTime;
    TYPE_PLAYER_STATE   m_eState;
	struct CheckOptions m_CheckOptions;
    

    //---HoleCard Information--------------------
    unsigned int        m_HoleCardsValues[2];
    unsigned int        m_AllCardsValues[7];
    unsigned int        m_AllCardValuesCont;
    unsigned int        m_uiNumHoleCards;
    unsigned int        m_highestCardsCount;
    //-------------------------------------------
    
    
    //-----Graphic variables-------------------
    CCSprite            *m_Sprite_Button_Dealer;
    CCSprite            *m_Sprite_Button_SmallBlind;
    CCSprite            *m_Sprite_Button_BigBlind;
    CCSprite            *m_Sprite_CardLeft;
    CCSprite            *m_Sprite_CardRight;
    CCSprite            *m_Sprite_CardLeft_Reverse;
    CCSprite            *m_Sprite_CardRight_Reverse;
    CCLabel             *m_sNameLabel;
    CCLabel             *m_sCurrentBetLabel;
    CCLabel             *m_sMoneyLabel;
    CCLabel             *m_sGainLabel;
    CCLabel             *m_sStateLabel;
    //------------------------------------------
    
    
    //---Money Information-----------------------
    int                 m_uiMoney;
    unsigned int        m_uiCurrentBet;
    unsigned int        m_uiTotalBet;
    unsigned int        m_uiToBank;
    unsigned int        m_uiCall;
    unsigned int        m_uiRaise;
    int                 m_uiGain;
    //-------------------------------------------
    
    struct Hand         m_HandValue;
    NSString*           m_Player;
}

- (void)                setPokerGame:(CPokerTexasHoldem*) poker;
- (void)                setPositionInfo:(CGPoint) pos;
- (void)                setRotationInfo:(float) rotation;
- (float)               getRotationInfo;
- (CGPoint)             getPositionInfo;
- (struct CheckOptions) getCheckOptions;
- (void)                resetStatus;
- (bool)                check:(unsigned int) currentBet deltaTime:(ccTime)delta firstBet:(bool) flag_firstBet;  
- (bool)                checkFirstBet:(ccTime)delta;
- (void)				searchOptions:(unsigned int) currentBet;
- (unsigned int)        getToBank;
- (unsigned int)        getRaise;
- (unsigned int)        getTotalBet;
- (unsigned int)        getCall;
- (void)                setHoleCards:(unsigned int)right LeftCard:(unsigned int) left;
- (void)                setName: (NSString *) theName;
- (void)                setMoney:(unsigned int) ammount;
- (int)                 getMoney;
- (void)                setGain:(int) ammount;
- (unsigned int)        getGain;
- (void)                setLose:(int) ammount;
- (void)                setCurrentBet:(unsigned int) ammount;
- (unsigned int)        getCurrentBet;
- (NSString *)          getName;
- (TYPE_PLAYER_STATE)   getPlayerState;
- (void)                setPlayerState:(TYPE_PLAYER_STATE) state;
- (void)                updatePlayerState:(TYPE_PLAYER_STATE) state;
- (unsigned int)        getHoleCard1;
- (unsigned int)        getHoleCard2;
- (bool)                isDelear;
- (bool)                isBigBlind;
- (bool)                isSmallBlind;
- (void)                setDealer:(bool) visible;
- (void)                setBigBlind:(bool) visible;
- (void)                setSmallBlind:(bool) visible;
- (void)                showCards;
- (void)                hideCards;
- (unsigned int)        getAllCardValuesCont;
- (unsigned int)        getNumHoleCards;
- (unsigned int)        getHighestCardCount;
- (unsigned int)        getHoleCardValue:(int) index;
- (unsigned int)        getCardValue:(int) index;
- (TYPE_PLAYER)         getPlayerType;
- (unsigned int)        getID;
- (void)                setID:(unsigned int) id;

- (void)                setm_highestCardsCount:(unsigned int)value;  // <-- AKEST NOM KAKA LA VAKA JOAN!!!!!!!!
- (void)                setCardValues:(unsigned int)card;
- (void)                setm_AllCardValuesCont:(unsigned int)value;
- (unsigned int)        getCard:(unsigned int)index;
- (void)                orderHighestCards;
- (void)                setBestHandValue;
- (int)                 getFigure:(int) card;
- (int)                 getNumCard:(int) card;

- (void)                cloningData:(CPlayer*) player;

//---------Per Saber quines cartes te....
- (void)                isRoyalFlush;
- (void)                isStraightFlush;
- (void)                isFourOfAKind;
- (void)                isFullHouse;
- (void)                isFlush;
- (void)                isStraight;
- (void)                isThreeOfAKind;
- (void)                isTwoPair;
- (void)                isOnePair;




@end
